package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.Brand;
import com.sk.cardeal.utils.HttpAddress;

import java.util.List;

/**
 * Created by sk on 2018/3/14.
 */

public class HotBrandAdapter extends BaseQuickAdapter<Brand,BaseViewHolder> {

    public HotBrandAdapter(int layoutResId, @Nullable List<Brand> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Brand item) {
        helper.setText(R.id.tv_name,item.getText());
        Glide.with(mContext).load(HttpAddress.ossPath+item.getIcon()).apply(RequestOptions.bitmapTransform(new CircleCrop())).into((ImageView) helper.getView(R.id.head));
    }
}
